<link rel="stylesheet" href="/assets/home/css/center.css" />

<!-- 头部 -->
<div class="user">
    <div class="avatar">
        <img src="{$auth['avatar_cdn']}" />
    </div>

    <div class="nickname">{$auth['nickname']}</div>
</div>

<!-- 菜单 -->
<div class="menulist">
    
    <div class="commonly-used">
        <div class="title">常用工具</div>
        <div class="list">
            <div class="item">
                <a href="{:url('/home/business/profile')}">
                    <img src="/assets/home/images/profile.png" alt="">
                    <div class="name">基本资料</div>
                </a>
            </div>

            <div class="item">
                <a href="{:url('/home/business/order')}">
                    <img src="/assets/home/images/order_1.png" alt="">
                    <div class="name">我的订单</div>
                </a>
            </div>

            <div class="item">
                <a href="course.html">
                    <img src="/assets/home/images/course.png" alt="">
                    <div class="name">我的课程</div>
                </a>
            </div>

            <div class="item">
                <a href="{:url('/home/business/email')}">
                    <img src="/assets/home/images/email.png" alt="">
                    <div class="name">邮箱认证</div>
                </a>
            </div>

            <div class="item">
                <a href="{:url('/home/business/coupon_list')}">
                    <img src="/assets/home/images/coupon.png" alt="">
                    <div class="name">我的优惠券</div>
                </a>
            </div>

            <div class="item">
                <a href="collection.html">
                    <img src="/assets/home/images/collection.png" alt="">
                    <div class="name">我的收藏</div>
                </a>
            </div>

            <div class="item">
                <a href="record.html">
                    <img src="/assets/home/images/record.png" alt="">
                    <div class="name">消费记录</div>
                </a>
            </div>

            <div class="item">
                <a href="recharge.html">
                    <img src="/assets/home/images/recharge.png" alt="">
                    <div class="name">余额充值</div>
                </a>
            </div>

            <div class="item">
                <a href="contact.html">
                    <img src="/assets/home/images/contact.png" alt="">
                    <div class="name">联系我们</div>
                </a>
            </div>

            <div class="item" id="logout">
                <a>
                    <img src="/assets/home/images/logout_1.png" alt="">
                    <div class="name">退出账号</div>
                </a>
            </div>
        </div>
    </div>

    <div class="promotion">
        <div class="title">推广管理</div>
        <div class="list">
            <div class="item">
                <a href="{:url('/home/team/poster')}">
                    <img src="/assets/home/images/poster.png" alt="">
                    <div class="name">推广海报</div>
                </a>
            </div>

            <div class="item">
                <a href="{:url('/home/team/team')}">
                    <img src="/assets/home/images/team.png" alt="">
                    <div class="name">我的团队</div>
                </a>
            </div>

            <div class="item">
                <a href="{:url('/home/business/money')}">
                    <img src="/assets/home/images/money.png" alt="">
                    <div class="name">提现</div>
                </a>
            </div>
        </div>
    </div>
</div>

<!-- 引入底部 -->
{include file='common/footer'/}

<script>
    $('#logout').click(() => {
        mui.confirm(
            '是否确认退出当前账号？',
            '退出账号',
            // ['确认','取消'],
            async function(res)
            {
                if(res.index === 1)
                {
                    // mui.toast('退出成功')
                    
                    // 关闭当前窗口
                    // $('.mui-popup-backdrop').remove()
                    // $('.mui-popup').remove()

                    let result = await POST({
                        // 控制器/方法名
                        url:'index/logout'
                    });

                    if(result.code === 1)
                    {
                        mui.toast(result.msg);

                        setTimeout(() => {
                            location.href = result.url
                        }, 2000)
                    }

                    
                }
            }
        )
    })
</script>